* net/shr.el (shr-descend): Don't bug out if the anchor is empty.
authorLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 5 Jan 2014 09:45:45 +0000 (10:45 +0100)
committerLars Magne Ingebrigtsen <larsi@gnus.org>
Sun, 5 Jan 2014 09:45:45 +0000 (10:45 +0100)
lisp/ChangeLog
lisp/net/shr.el

index 05650eb65bed5dedf8728d9abe4d27a0f52f6e8e..acb8b7ec2f8b2bf5b0a07d6477d36ede926b4038 100644 (file)
@@ -1,3 +1,8 @@
+2014-01-05  Lars Magne Ingebrigtsen  <larsi@gnus.org>
+
+       * net/shr.el (shr-descend): Don't bug out if the anchor is empty
+       (bug#16285).
+
 2014-01-05  Kenjiro NAKAYAMA  <nakayamakenjiro@gmail.com>
 
        * net/eww.el (eww):  Support single/double quote for search.
index 4dc3bb2481212233c8f0250949821a111888330c..77ebf474bc11a39568468e8d340b253bd3951d09 100644 (file)
@@ -380,6 +380,10 @@ size, and full-buffer size."
        (shr-generic (cdr dom)))
       (when (and shr-target-id
                 (equal (cdr (assq :id (cdr dom))) shr-target-id))
+       ;; If the element was empty, we don't have anything to put the
+       ;; anchor on.  So just insert a dummy character.
+       (when (= start (point))
+         (insert "*"))
        (put-text-property start (1+ start) 'shr-target-id shr-target-id))
       ;; If style is set, then this node has set the color.
       (when style